package edu.umassd.visual.options;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JTextField;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import edu.umassd.visual.View;

@Component("width")
public class SetWidth implements ActionListener
{
	@Autowired
	private View view;

	@Override
	public void actionPerformed(ActionEvent e)
	{
		JTextField field = (JTextField) e.getSource();

		try
		{
			view.updateWidth(Double.parseDouble(field.getText()));
		}
		catch (NumberFormatException e1)
		{

		}
	}

}
